package com.hstc.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class WeatherService {
    @Tool(description = "根据城市名称获取天气预报")
    public String getWeatherByCity(String city){
        Map<String,String> map = Map.of(
                "北京","111北京天气下雨",
                "上海","222多云",
                "深圳","333阴天"
        );
        return map.getOrDefault(city, "抱歉，未查询到对应城市");
    }

}
